package com.design.pattern.behavioral.observer;

/**
 * description
 *
 * @author RenQiQiang 2019/03/28 9:44
 */
public class Test {

    public static void main(String[] args) {
        Course course = new Course("java设计模式精讲");
        Teacher teacher = new Teacher("alpa");
        Teacher teacher2 = new Teacher("alpa2");
        course.addObserver(teacher);
        course.addObserver(teacher2);

        Question question = new Question();
        question.setUserName("rqq");
        question.setQuestionContext("问题");

        course.produceQuestion(course, question);
    }
}
